#include<bits/stdc++.h>
using namespace std;
int a[100005],b[100005];
vector<int> v;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
		scanf("%d",&a[i]);
	}
	sort(a+1,a+1+n);
	int k=INT_MIN,cnt;
	for(int i=1;i<=n;i++)
	{
	    int now=k;
		if(a[i]!=k)
		{
			k=a[i];
			if(now!=INT_MIN) v.push_back(cnt);
			cnt=1;
		}
		else
		{
			cnt++;
		}
	}
	v.push_back(cnt);
	for(int i=0;i<v.size();i++)
    {
        b[i]=v[i];
    }
	int ans=n;
	for(int i=0;i<v.size();i++)
	{
	    int f=0;
		int k=i;
		while(1)
		{
			k++;
			if(k>=v.size())
            {
                f=1;
                break;
            }
			if(v[i]-b[k]>=0)
            {
                v[i]-=b[k];
                ans-=b[k];
                b[k]=0;
            }
            else
            {
                ans-=v[i];
                v[i]=0;
                b[k]-=v[i];
                break;
            }
		}
		if(f==1) break;
	}
	cout<<ans;
    return 0;
}
